import React from 'react'
import { Box } from '$components';
import ThreeDBarChart from './charts/bar';
import { useFsRequest } from '$utils';
function PopulationDynamics() {

    const { data: homes = {} } = useFsRequest({ url: 'home/person' });
    const data = [
        homes?.home?.filter(s => parseInt(s.count) == 1)?.length || 0,
        homes?.home?.filter(s => parseInt(s.count) == 2)?.length || 0,
        homes?.home?.filter(s => parseInt(s.count) == 3)?.length || 0,
        homes?.home?.filter(s => parseInt(s.count) == 4)?.length || 0,
        homes?.home?.filter(s => parseInt(s.count) > 4)?.length || 0,
    ]
    return <Box title={"租户家庭人口统计"} >
        <ThreeDBarChart data={data} />
    </Box>
}

export default PopulationDynamics;


